<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport"
	      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>test_transform</title>
	
	<style>

		.div_trans{
			width: 200px; height: 200px;
			background: #f0f;
			position: absolute;
			left: 50%;
			top: 50%;
			transform:translate(-100px,-100px) ;
		}
		
	</style>
	
</head>
<body>

练习:面试题: <br>
使用css,让一个div在任何情况下,都处于页面中心 <br>

<div class="div_trans">我是一个测试的div</div>


</body>
</html>